package com.atguigu04.other.annotation;

import org.junit.Test;

import java.lang.annotation.Annotation;
import java.lang.reflect.Field;

public class AnnotationTest {



    @Test
    public void test1() {

        Class customerClass = Customer.class;

        Table table = (Table)customerClass.getDeclaredAnnotation(Table.class);
        System.out.println(table.value());

    }

    @Test
    public void test2() throws NoSuchFieldException {

        Class customerClass = Customer.class;

        Field name = customerClass.getDeclaredField("name");
        Column column = name.getDeclaredAnnotation(Column.class);
        System.out.println(column.columnName());
        System.out.println(column.columnType());

    }
}
